﻿using NUnit.Framework;
using System.Collections.Generic;
using OpenSda.Agilcont.Common.Data.Contracts;
using OpenSda.Agilcont.Common.Data.Entities;

namespace OpenSda.Agilcont.Common.Data.NhContexts.NuTest
{

    [TestFixture]
    public class CentroCostoTest : AbstractBaseDataTests
    {
        private ICentroCostoData target;
        private IAgenciaData agenciaData;

        // These properties will be injected based on type
        public ICentroCostoData CentroCostoData { set { target = value; } }
        public IAgenciaData AgenciaData { set { agenciaData = value; } }


        [Test]
        public void SaveTest()
        {
            CentroCosto centroCosto = this.Save();
            Assert.IsNotNull(centroCosto.Identity);
        }

        private CentroCosto Save()
        {
            Agencia c = agenciaData.GetAll()[0];

            return target.Save(new CentroCosto()
            {
                Codigo = "16486531",
                Nombre= "Silvana",
                AgenciaRef = c
               //CentroCostoRef = ?
            });
        }


    }
}
